package cn.zjitc.craft.dao.impl;

import cn.zjitc.craft.dao.UserDao;
import cn.zjitc.craft.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository("userDao")
public class UserDaoImpl implements UserDao {

    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Override
    public void save(User user) {
        String sql = "insert into user(name,password) values(?,?)";
        jdbcTemplate.update(sql,user.getName(),user.getPassword());
    }
}
